package com.foreknow.elm.service.impl;

import com.foreknow.elm.dao.BusinessDao;
import com.foreknow.elm.dao.impl.BusinessDaoImpl;
import com.foreknow.elm.po.Business;
import com.foreknow.elm.service.BusinessService;
import com.foreknow.elm.util.DBUtil;

import java.util.Collections;
import java.util.List;

public class BusinessServiceImpl implements BusinessService {
    @Override
    public List<Business> listBusinessByOrderTypeId(int orderTypeId) {
        BusinessDao businessDao = new BusinessDaoImpl();
        List<Business> list = null;
        try {
            //调用Dao层的方法
            list = businessDao.listBusinessByOrderTypeId(orderTypeId);
        }catch (Exception e){

        }finally {
            DBUtil.close();
        }
        return list;
    }

    @Override
    public Business getBusinessById(int businessId) {
        BusinessDao businessDao = new BusinessDaoImpl();
        Business business = null;
        try {
            //调用Dao层的方法
            business = businessDao.getBusinessById(businessId);
        }catch (Exception e){

        }finally {
            DBUtil.close();
        }
        return business;
    }
}
